package com.zhuangjie.coupon.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author zhuangjie
 * @since 2024-02-28
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("coupon")
@ApiModel(value = "Coupon对象", description = "")
public class Coupon implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("优惠卷id")
    @TableField("id")
    private Long id;

    @ApiModelProperty("批次id")
    @TableField("batch_id")
    private Long batchId;

    @ApiModelProperty("领取的用户id")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty("膨胀的那部分优惠金额(n+m的m)")
    @TableField("expansion_amount")
    private BigDecimal expansionAmount;

    @ApiModelProperty("使用优惠卷的订单id")
    @TableField("order_id")
    private Long orderId;

    @ApiModelProperty("优惠券状态（0未使用，1 锁定中(订单未完成) 2已使用 -1已失效（券使用退货后券失效场景））")
    @TableField("state")
    private Byte state;

    @ApiModelProperty("过期时间")
    @TableField("expiration_time")
    private LocalDateTime expirationTime;

    @ApiModelProperty("使用时间")
    @TableField("usage_time")
    private LocalDateTime usageTime;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;



}

